<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h1>count的值是：{{count}}</h1>
    <!--默认传递event对象-->
    <button @click="handler">点击</button>
    <!--明确传递实参10此时如需要event对象就需要使用$event进行占位-->
    <button @click="add(10,$event)">++</button>
</div>
<script src="../../JavaScript/vue.js"></script>
<script>
    const app = Vue.createApp({
        data() {
            return {
                count: 0
            }
        },
        methods: {
            add(value, event) {
                this.count += value
                console.log(event)
            },
            handler(event) {
                // 如果在绑定事件的时候没有传递任何参数那么默认有个event对象
                console.log(event.target)
            }
        }
    })
    app.mount("#app")
</script>
</body>
</html>